package com.github.prontera.domain;

import java.math.BigDecimal;
import java.time.OffsetDateTime;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.github.prontera.domain.enums.ConsumeLevelTypeEnum;
import com.github.prontera.domain.enums.ConsumeSmallTypeEnum;
import com.github.prontera.domain.enums.ConsumeTypeEnum;
import com.github.prontera.model.BasicDomain;
import com.github.prontera.util.converter.jackson.OffsetDateTimeToIso8601Serializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * u_consume-消费
 *
 */
@ToString
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
public class Consume extends BasicDomain{

	private static final long serialVersionUID = 1L;
    
	/**
	 * 
	 */
	@ApiModelProperty(value = "")
    private Long clientId;
	/**
	 * 消费说明
	 */
	@ApiModelProperty(value = "消费说明")
	private String lable;
	/**
	 * 
	 */
	@ApiModelProperty(value = "")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime updateTime;
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime createTime;
	/**
	 * 金额
	 */
	@ApiModelProperty(value = "金额")
    private BigDecimal amount;
	/**
	 * 使用金额--->目前只在充值唐豆豆使用这个字段
	 */
	@ApiModelProperty(value = "使用金额")
    private BigDecimal baseAmount;
 
	@ApiModelProperty(value = "消费类型 0:收入,1:支出 ")
    private ConsumeTypeEnum type;
    /**
	 * 详细等级, 0:查看视频, 1:查看圈子, 2:系统赠送, 3:系统抵扣,4:查看微信
	 */
	@ApiModelProperty(value = "详细等级, 0:查看视频, 1:查看圈子, 2:系统赠送, 3:系统抵扣,4:查看微信,5:充值唐豆,6:参与活动,7:充值余额,8:购买VIP,9:提现押金")
    private ConsumeSmallTypeEnum consumeType;
	/**
	 * 唐豆
	 */
	@ApiModelProperty(value = "唐豆")
    private Integer myBean;
	/**
	 * 状态, 0:发起请求,1:待处理,2:处理中(打款但未回调) 3:处理失败,4:处理成功
	 */
	@ApiModelProperty(value = "状态, 0:发起请求,1:待处理,2:处理中(打款但未回调) 3:处理失败,4:处理成功")
    private Integer status;
	/**
	 * 原因
	 */
	@ApiModelProperty(value = "原因")
    private String reason;
	/**
	 * 昵称
	 */
	@ApiModelProperty(value = "昵称")
    private String nikename;
	/**
	 *用户手机号
	 */
	@ApiModelProperty(value = "用户手机号")
    private String mobile;
	
	/**
	 * 详细等级 0:收入,1:押金,2:余额,3:唐豆豆
	 */
	@ApiModelProperty(value = "详细等级 0:收入,1:押金,2:余额,3:唐豆豆")
    private ConsumeLevelTypeEnum levelType;
	/**
	 * 
	 */
	@ApiModelProperty(value = "")
    private Integer orderType;
	/**
	 * 
	 */
	@ApiModelProperty(value = "客户端")
    private Client client;
	
	public Client getClient() {
		return client;
	}

	public String getMobile() {
		if(client!=null){
			return client.getMobile();
		}
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public BigDecimal getBaseAmount() {
		return baseAmount;
	}

	public void setBaseAmount(BigDecimal baseAmount) {
		this.baseAmount = baseAmount;
	}

	/**
	 * @return the orderType
	 */
	public Integer getOrderType() {
		return orderType;
	}

	/**
	 * @param orderType the orderType to set
	 */
	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}

	public Consume(){
    
    }

	/**
	 * 
	 * @return the levelType
	 */
	public ConsumeLevelTypeEnum getLevelType() {
		return levelType;
	}




	/**
	 * @param levelType the levelType to set
	 */
	public void setLevelType(ConsumeLevelTypeEnum levelType) {
		this.levelType = levelType;
	}


	public String getNikename() {
		if(client!=null){
			return client.getNickname();
		}
		return nikename;
	}

	public void setNikename(String nikename) {
		this.nikename = nikename;
	}

	public Long getClientId() {
        return this.clientId;
    }
    
    public void setClientId(Long clientId) {
        this.clientId = clientId;
    }
    public String getLable() {
        return this.lable;
    }
    
    public void setLable(String lable) {
        this.lable = lable;
    }
    public OffsetDateTime getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(OffsetDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public OffsetDateTime getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(OffsetDateTime createTime) {
        this.createTime = createTime;
    }
    public BigDecimal getAmount() {
        return this.amount;
    }
    
    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }
    public ConsumeTypeEnum getType() {
        return this.type;
    }
    
    public void setType(ConsumeTypeEnum type) {
        this.type = type;
    }
    public ConsumeSmallTypeEnum getConsumeType() {
        return this.consumeType;
    }
    
    public void setConsumeType(ConsumeSmallTypeEnum consumeType) {
        this.consumeType = consumeType;
    }
    public Integer getMyBean() {
        return this.myBean;
    }
    
    public void setMyBean(Integer myBean) {
        this.myBean = myBean;
    }
    public Integer getStatus() {
        return this.status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getReason() {
        return this.reason;
    }
    
    public void setReason(String reason) {
        this.reason = reason;
    }
    
}
